# Contributor: Leon Marz <lmarz@cs.uni-frankfurt.de>
# Maintainer: Leon Marz <lmarz@cs.uni-frankfurt.de>
pkgname=blosc
pkgver=1.20.0
pkgrel=0
pkgdesc="A blocking, shuffling and lossless compression library"
url="https://blosc.org"
arch="all !armhf" # build failure
license="BSD-3-Clause"
makedepends="cmake lz4-dev zlib-dev zstd-dev"
subpackages="$pkgname-static $pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/Blosc/c-blosc/archive/v$pkgver.tar.gz"
builddir="$srcdir/c-blosc-$pkgver"

build() {
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None \
		-DBUILD_BENCHMARKS=OFF \
		-DPREFER_EXTERNAL_LZ4=ON \
		-DPREFER_EXTERNAL_ZLIB=ON \
		-DPREFER_EXTERNAL_ZSTD=ON \
		.
	make -C build
}

check() {
	CTEST_OUTPUT_ON_FAILURE=1 make -C build test
}

package() {
	make -C build DESTDIR="$pkgdir" install
}

sha512sums="b3da9970542c389fce4acb6ffb866c066dfbf542fadb21ed3d6a7688f9cccf89425ccdc9253a1f7172eced224ff27b78be0c9ce111b4b69ec303a61fb7c1bc10  blosc-1.20.0.tar.gz"
